#pragma once

#include <QFileInfo>
#include <QDomElement>
#include <QMap>
#include <QRect>
#include <QPixmap>
#include "mediaitem.h"

class MediaItemImpl : public MediaItem
{
public:
    MediaItemImpl();
    MediaItemImpl(const Metadata & metadata);
    virtual ~MediaItemImpl();

    void setSelected(bool selected);
    void setChecked(bool checked);

    virtual bool isSelected() const;
    virtual bool isChecked() const;
    virtual const Metadata & metadata() const;
    virtual class MediaItemImpl * impl();

private:
    void load(QDomElement & e);
    void save(QDomElement & e);

private:
    Metadata m_metadata;
    bool m_selected;
    bool m_checked;
    QRect m_rect;
    QWeakPointer<QPixmap> m_icon;

    friend class CollectionView;
    friend class PioCoreImpl;
    friend class Database;
};
